home *** CD-ROM | disk | FTP | other *** search
/ GameStar Special 2004 September / GSSH0904CD1.iso / RiseofNations / RedFront / RedFront.exe / Red Front / Red Front - 09 - Kharkov.bhs < prev    next >
Text File  |  2004-02-06  |  36KB  |  1,021 lines

  1. /* Red Front
  2.    Kharkov
  3.    
  4.    These events will control the Kharkov scenario for the Red Front campaign.
  5.   
  6.    Campaign By: Kevin 'DarthVeda' Chulski
  7.    Contact: darthveda@hotmail.com
  8.    Please email any questions/suggestions/comments that you have!   
  9. */
  10.  
  11. scenario
  12. {
  13.  
  14.   set_nation_name("Russians", $S("Red Army"));
  15.   set_nation_name("Romans", $S("Germans"));
  16.   
  17.   // initialize variables
  18.   
  19.   static int month = 2;
  20.   static int day = 1;
  21.   static int dayRate = 240;
  22.   static int rallyID = 0;
  23.   static int i = 0;
  24.   static int X = 0;
  25.   static int Y = 0;
  26.   static int X2 = 0;
  27.   static int Y2 = 0;  
  28.   static int mouseX = 0;
  29.   static int mouseY = 0;
  30.   
  31.   // shelling
  32.   static int ALL_SHELL_DELAY = 1;
  33.   static int SOV_SHELL_DELAY = 1;
  34.   static int MIN_SHELL = 1;
  35.   static int MAX_SHELL = 2;
  36.   static int ART_RADIUS = 20;
  37.   
  38.   // respawn delays
  39.   static int sovDelay = 15;
  40.   static int gerDelay = 15;
  41.   
  42.   // RPG Stuff
  43.   
  44.   static int commandoID = find_unit( 1, "Special Forces" );
  45.   static int current_health = 550;
  46.   static int healDelay = 5;
  47.   static int current_level = 1;
  48.   static int exp_needed = 10;
  49.   static int exp_gained = 0;
  50.   static int last_index_of_kills = 0;
  51.   static int artillery_percent = 0;
  52.   static int artillery_max = 100;
  53.   static int artillery_fired = 0;
  54.   static int lead_percent = 0;
  55.   static int lead_max = 100;
  56.   static int rally_percent = 0;
  57.   static int rally_max = 100;
  58.   static int heal_percent = 0;
  59.   static int heal_max = 100;
  60.   
  61. labels {
  62.   //Add any constant labels here in a comma separated list.
  63.   
  64. }
  65.  
  66. run_once {
  67.   //Insert commands that should be executed only once when the script is loaded here.
  68.   
  69.   //disable weird things
  70.   
  71.   disable_type("Helicopter");
  72.   disable_type("Nuclear Missile");
  73.   disable_type("Missile Silo");
  74.   disable_type("Aircraft Carrier");
  75.   disable_type("Spy");
  76.   
  77.   if ( building_resource_bonus_disable() != 1 )
  78.   {
  79.     print_game_msg( "Error: couldn't disable building resources!" );
  80.   }
  81.   if ( buildings_gather_disable() != 1 )
  82.   {
  83.     print_game_msg( "Error: couldn't disable building gather!" );
  84.   }
  85.   if ( plunder_disable() != 1 )
  86.   {
  87.     print_game_msg( "Error: couldn't disable plunder!" );
  88.   }
  89.   
  90.   
  91.   // disable wonders
  92.   
  93.   disable_type( "Pyramids" );
  94.   disable_type( "Colossus" );
  95.   disable_type( "Terra Cotta Army" );
  96.   disable_type( "Colosseum" );
  97.   disable_type( "Temple of Tikal" );
  98.   disable_type( "Porcelain Tower" );
  99.   disable_type( "Angkor Wat" );
  100.   disable_type( "Versailles" );
  101.   disable_type( "Statue of Liberty" );
  102.   disable_type( "Kremlin" );
  103.   disable_type( "Taj Mahal" );
  104.   disable_type( "Eiffel Tower" );
  105.   disable_type( "Supercollider" );
  106.   disable_type( "Space Program" );
  107.   
  108.   // disable certain buildings and guys
  109.   
  110.   disable_type( "Small City" );
  111.   disable_type( "Citizen" );
  112.   disable_type( "Temple" );
  113.   disable_type( "Library" );
  114.   disable_type( "University" );
  115.   disable_type( "Airbase" );
  116.   disable_type( "Caravan" );
  117.   disable_type( "Supply Wagon" );
  118.   disable_type( "Shipyard" );
  119.   disable_type( "General" );
  120.   
  121.   // disable ships
  122.   
  123.   disable_type("Submarine");
  124.   disable_type("Battleship");
  125.   disable_type("Cruiser");
  126.   
  127.   // Gain Upgrades
  128.   gain_upgrade(2, "Tactics");//Gain research tactics
  129.   gain_upgrade(2, "Operations");//Gain research operations
  130.   gain_upgrade(2, "Strategy");//Gain research strategy 
  131.   
  132.   // disable upgrades 
  133.   
  134.   // set timers
  135.   
  136.   set_timer( "cdar", dayRate );
  137.   set_timer( "allshell", 60 );
  138.   set_timer( "sovshell", SOV_SHELL_DELAY );
  139.   set_timer( "gerinforce", 15);
  140.   set_timer( "sovinforce", 15);
  141.   set_timer( "healing" , 1);
  142.   
  143.   set_timer( "chargeability", 1);
  144.     
  145.   // disable triggers
  146.   
  147.   disable_trigger( "move_the_gen" );
  148.   disable_trigger( "player_unleashes" );
  149.   
  150.   // blurb or cinematic
  151.   
  152.   // miscelaneous  
  153.   
  154.   for( i = 1; i < 6; i++ )
  155.   {
  156.     force_transport_ability( i );
  157.     if ( i >= 2 )
  158.     {
  159.       disable_production_ai( i );
  160.     }
  161.   }
  162.   
  163.   set_object_type_max_health( "Barracks", 10000 );
  164.   set_object_type_max_health( "Market", 10000 );
  165.   set_object_type_max_health( "Granary", 10000 );
  166.   set_object_type_max_health( "Refinery", 15000 );
  167.   set_object_type_max_health( "Smelter", 15000 );
  168.   set_object_type_max_health( "Library", 15000 );
  169.   set_object_type_max_health( "Versailles", 20000 );
  170.   
  171.   set_defeat_message( "You were killed in action!" );
  172.        
  173. }
  174.  
  175. //Main script body.
  176. //Add triggers and other commands to be executed each game frame here.
  177. //Use Edit->Insert Trigger Function to select from the list of available functions
  178. //Use Edit->Insert Trigger Block to add a blank trigger block.
  179. //See ./scenario/sample_script.bhs for additional documentation
  180.  
  181.   trigger opening_scene ( )
  182.   {
  183.     set_msg_time(20);//Sets message time to 20 seconds
  184.     move_camera( 36,26 );
  185.     scrolling_lock();//Locks scrolling
  186.     zooming_lock();//Locks zooming
  187.     hotkey_selection_disable();//disables hotkey selection
  188.     ui_hide();//Hides the UI
  189.     mouse_selection_disable();//disables mouse selection
  190.     print_msg( "February 1943 - In light of the great victory on the Volga, Stalin has ordered a great offensive to retake the Motherland, starting in the city of Kharkov." ); 
  191.     set_timer( "opener", 6 );
  192.   }
  193.   
  194.   trigger opening_dialog ( timer_expired( "opener" ) )
  195.   {
  196.     move_camera( 36,26 ); //Moves camera from action scene
  197.     set_msg_time( 6 ); //Resets message time to default
  198.     clear_msg(); //clears text
  199.     scrolling_unlock();
  200.     zooming_unlock();
  201.     hotkey_selection_enable();
  202.     mouse_selection_enable();
  203.     ui_show();
  204.     add_objective_text( "Date: February 1, 1943", "date", "null.wav" );
  205.     popup_dialog( "Your objective is simple, use your commando skills to support the armies of the glorious Soviet Union while they liberate Kharkov from the fascist invaders.");
  206.     popup_dialog( "NEW OBJECTIVE: Kharkov must be liberated" );
  207.     add_objective( "Kharkov must be liberated", "hold", "null.wav" );
  208.     add_objective_text( "Current Level: 1", "level", "null.wav" );
  209.     add_objective_text( "[" + exp_gained + "/" + exp_needed + "] Experience", "exp", "null.wav" );
  210.     popup_dialog( "TIP: To gain experience, you must kill units.  When targetting infantry squads, you must kill the last unit of any squad for it to count.  Additionally, you can garrison in your barracks to recharge your health and craft." );
  211.     
  212.   }
  213.    
  214.   trigger calendar ( timer_expired( "cdar" ) )
  215.   {  
  216.     if ( day == 20 && month == 2 )
  217.     {
  218.       // It's the end of the scenario
  219.       popup_dialog( "Unable to complete the liberation of Kharkov, the armies of the Soviet Union have been called off in the face of an overwhelming counter-attack from the Germans.  It will be a long time before the army will dare mount another offensive with such a failure." );
  220.       defeat( 1 );
  221.     }
  222.     else
  223.     {
  224.       // normal increment
  225.       day++;
  226.     }
  227.  
  228.     change_objective_text( "date", "February " + day + ", 1943" );
  229.  
  230.     set_timer( "cdar", dayRate );    
  231.     enable_trigger( "calendar" );
  232.   }
  233.   
  234.   trigger end_warning ( day == 18 )
  235.   {
  236.     popup_dialog( "Stalin has given you two days to capture the city." );
  237.   }
  238.  
  239.   trigger sov_attack( timer_expired( "sovinforce" ) )
  240.   {
  241.     // These variables will make it easier to balance later
  242.     int sovMen = 10;
  243.     
  244.     // Northern Group
  245.     if ( find_city_owner( "North Northwest" ) != 2 )
  246.     {
  247.       create_unit( 2, 12, 33, "Riflemen", sovMen );
  248.       group_attack_to_order( 2, 72, 128 );
  249.       create_unit( 2, 12, 33, "Tank", 1 );
  250.       group_attack_to_order( 2, 72, 128 );
  251.       create_unit( 2, 12, 33, "Heavy Machine Gun", 1 );
  252.       group_attack_to_order( 2, 72, 128 );
  253.     }
  254.     else if( find_city_owner( "City Square" ) != 2 )
  255.     {
  256.       create_unit( 2, 72, 128, "Riflemen", sovMen );
  257.       group_attack_to_order( 2, 49, 173 );
  258.       create_unit( 2, 72, 128, "Tank", 1 );
  259.       group_attack_to_order( 2, 49, 173 );
  260.       create_unit( 2, 72, 128, "Heavy Machine Gun", 1 );
  261.       group_attack_to_order( 2, 49, 173 );
  262.     }
  263.     else if ( find_city_owner( "Northwest" ) != 2 )
  264.     {
  265.       create_unit( 2, 49, 173, "Riflemen", sovMen );
  266.       group_attack_to_order( 2, 33, 219 );
  267.       create_unit( 2, 49, 173, "Tank", 1 );
  268.       group_attack_to_order( 2, 33, 219 );
  269.       create_unit( 2, 49, 173, "Heavy Machine Gun", 1 );
  270.       group_attack_to_order( 2, 33, 219 );
  271.     }
  272.     else if ( find_city_owner( "North Crossing B" ) != 2 )
  273.     {
  274.       create_unit( 2, 33, 219, "Riflemen", sovMen );
  275.       group_attack_to_order( 2, 55, 263 );
  276.       create_unit( 2, 33, 219, "Tank", 1 );
  277.       group_attack_to_order( 2, 55, 263 );
  278.       create_unit( 2, 33, 219, "Heavy Machine Gun", 1 );
  279.       group_attack_to_order( 2, 55, 263 );
  280.     }
  281.     else if ( find_city_owner( "North Crossing A" ) != 2 )
  282.     {
  283.       create_unit( 2, 55, 263, "Riflemen", sovMen );
  284.       group_attack_to_order( 2, 72, 289 );
  285.       create_unit( 2, 55, 263, "Tank", 1 );
  286.       group_attack_to_order( 2, 72, 289 );
  287.       create_unit( 2, 55, 263, "Heavy Machine Gun", 1 );
  288.       group_attack_to_order( 2, 72, 289 );
  289.     }
  290.     else if ( find_city_owner( "Industrial NNW" ) != 2 )
  291.     {
  292.       create_unit( 2, 72, 289, "Riflemen", sovMen );
  293.       group_attack_to_order( 2, 41, 347 );
  294.       create_unit( 2, 72, 289, "Tank", 1 );
  295.       group_attack_to_order( 2, 41, 347 );
  296.       create_unit( 2, 72, 289, "Heavy Machine Gun", 1 );
  297.       group_attack_to_order( 2, 41, 347 );
  298.     }
  299.     
  300.     // Mid Group
  301.     if ( find_city_owner( "Center Northeast" ) != 2 )
  302.     {
  303.       create_unit( 2, 39, 34, "Riflemen", sovMen );
  304.       group_attack_to_order( 2, 108, 91 );
  305.       create_unit( 2, 39, 34, "Tank", 1 );
  306.       group_attack_to_order( 2, 108, 91 );
  307.       create_unit( 2, 39, 34, "Heavy Machine Gun", 1 );
  308.       group_attack_to_order( 2, 108, 91 );
  309.     }
  310.     else if( find_city_owner( "City Center" ) != 2 )
  311.     {
  312.       create_unit( 2, 108, 91, "Riflemen", sovMen );
  313.       group_attack_to_order( 2, 167, 136 );
  314.       create_unit( 2, 108, 91, "Tank", 1 );
  315.       group_attack_to_order( 2, 167, 136 );
  316.       create_unit( 2, 108, 91, "Heavy Machine Gun", 1 );
  317.       group_attack_to_order( 2, 167, 136 );
  318.     }
  319.     else if ( find_city_owner( "West Crossing B" ) != 2 )
  320.     {
  321.       create_unit( 2, 167, 136, "Riflemen", sovMen );
  322.       group_attack_to_order( 2, 227, 204 );
  323.       create_unit( 2, 167, 136, "Tank", 1 );
  324.       group_attack_to_order( 2, 227, 204 );
  325.       create_unit( 2, 167, 136, "Heavy Machine Gun", 1 );
  326.       group_attack_to_order( 2, 227, 204 );
  327.     }
  328.     else if ( find_city_owner( "West Crossing A" ) != 2 )
  329.     {
  330.       create_unit( 2, 227, 204, "Riflemen", sovMen );
  331.       group_attack_to_order( 2, 231, 237 );
  332.       create_unit( 2, 227, 204, "Tank", 1 );
  333.       group_attack_to_order( 2, 231, 237 );
  334.       create_unit( 2, 227, 204, "Heavy Machine Gun", 1 );
  335.       group_attack_to_order( 2, 231, 237 );
  336.     }
  337.     else if ( find_city_owner( "Industrial Residence" ) != 2 )
  338.     {
  339.       create_unit( 2, 231, 237, "Riflemen", sovMen );
  340.       group_attack_to_order( 2, 250, 280 );
  341.       create_unit( 2, 231, 237, "Tank", 1 );
  342.       group_attack_to_order( 2, 250, 280 );
  343.       create_unit( 2, 231, 237, "Heavy Machine Gun", 1 );
  344.       group_attack_to_order( 2, 250, 280 );
  345.     }
  346.     else if ( find_city_owner( "Industrial Southwest" ) != 2 )
  347.     {
  348.       create_unit( 2, 250, 280, "Riflemen", sovMen );
  349.       group_attack_to_order( 2, 311, 320 );
  350.       create_unit( 2, 250, 280, "Tank", 1 );
  351.       group_attack_to_order( 2, 311, 320 );
  352.       create_unit( 2, 250, 280, "Heavy Machine Gun", 1 );
  353.       group_attack_to_order( 2, 311, 320 );
  354.     } 
  355.     
  356.     // Midsouth Group   
  357.     if ( find_city_owner( "Suburbs" ) != 2 )
  358.     {
  359.       create_unit( 2, 48, 14, "Riflemen", sovMen );
  360.       group_attack_to_order( 2, 156, 84 );
  361.       create_unit( 2, 48, 14, "Tank", 1 );
  362.       group_attack_to_order( 2, 156, 84 );
  363.       create_unit( 2, 48, 14, "Heavy Machine Gun", 1 );
  364.       group_attack_to_order( 2, 156, 84 );
  365.     }
  366.     else if( find_city_owner( "Central South" ) != 2 )
  367.     {
  368.       create_unit( 2, 156, 84, "Riflemen", sovMen );
  369.       group_attack_to_order( 2, 213, 158 );
  370.       create_unit( 2, 156, 84, "Tank", 1 );
  371.       group_attack_to_order( 2, 213, 158 );
  372.       create_unit( 2, 156, 84, "Heavy Machine Gun", 1 );
  373.       group_attack_to_order( 2, 213, 158 );
  374.     }
  375.     else if ( find_city_owner( "South Crossing B" ) != 2 )
  376.     {
  377.       create_unit( 2, 213, 158, "Riflemen", sovMen );
  378.       group_attack_to_order( 2, 265, 152 );
  379.       create_unit( 2, 213, 158, "Tank", 1 );
  380.       group_attack_to_order( 2, 265, 152 );
  381.       create_unit( 2, 213, 158, "Heavy Machine Gun", 1 );
  382.       group_attack_to_order( 2, 265, 152 );
  383.     }
  384.     else if ( find_city_owner( "South Crossing A" ) != 2 )
  385.     {
  386.       create_unit( 2, 265, 152, "Riflemen", sovMen );
  387.       group_attack_to_order( 2, 294, 172 );
  388.       create_unit( 2, 265, 152, "Tank", 1 );
  389.       group_attack_to_order( 2, 294, 172 );
  390.       create_unit( 2, 265, 152, "Heavy Machine Gun", 1 );
  391.       group_attack_to_order( 2, 294, 172 );
  392.     }
  393.     else if ( find_city_owner( "Industrial South" ) != 2 )
  394.     {
  395.       create_unit( 2, 294, 172, "Riflemen", sovMen );
  396.       group_attack_to_order( 2, 331, 239 );
  397.       create_unit( 2, 294, 172, "Tank", 1 );
  398.       group_attack_to_order( 2, 331, 239 );
  399.       create_unit( 2, 294, 172, "Heavy Machine Gun", 1 );
  400.       group_attack_to_order( 2, 331, 239 );
  401.     }
  402.     else if ( find_city_owner( "South Bank Industrial" ) != 2 )
  403.     {
  404.       create_unit( 2, 331, 239, "Riflemen", sovMen );
  405.       group_attack_to_order( 2, 342, 265 );
  406.       create_unit( 2, 331, 239, "Tank", 1 );
  407.       group_attack_to_order( 2, 342, 265 );
  408.       create_unit( 2, 331, 239, "Heavy Machine Gun", 1 );
  409.       group_attack_to_order( 2, 342, 265 );
  410.     } 
  411.     
  412.     // South Group
  413.     if ( find_city_owner( "East Bank Industrial" ) != 2 )
  414.     {
  415.       create_unit( 2, 189, 7, "Riflemen", sovMen );
  416.       group_attack_to_order( 2, 195, 21 );
  417.       create_unit( 2, 189, 7, "Tank", 1 );
  418.       group_attack_to_order( 2, 195, 21 );
  419.       create_unit( 2, 189, 7, "Heavy Machine Gun", 1 );
  420.       group_attack_to_order( 2, 195, 21 );
  421.     }
  422.     else if( find_city_owner( "East Crossing B" ) != 2 )
  423.     {
  424.       create_unit( 2, 195, 21, "Riflemen", sovMen );
  425.       group_attack_to_order( 2, 238, 91 );
  426.       create_unit( 2, 195, 21, "Tank", 1 );
  427.       group_attack_to_order( 2, 238, 91 );
  428.       create_unit( 2, 195, 21, "Heavy Machine Gun", 1 );
  429.       group_attack_to_order( 2, 238, 91 );
  430.     }
  431.     else if ( find_city_owner( "Southwest Square" ) != 2 )
  432.     {
  433.       create_unit( 2, 238, 91, "Riflemen", sovMen );
  434.       group_attack_to_order( 2, 291, 57 );
  435.       create_unit( 2, 238, 91, "Tank", 1 );
  436.       group_attack_to_order( 2, 291, 57 );
  437.       create_unit( 2, 238, 91, "Heavy Machine Gun", 1 );
  438.       group_attack_to_order( 2, 291, 57 );
  439.     }
  440.     else if ( find_city_owner( "Southwest Corner" ) != 2 )
  441.     {
  442.       create_unit( 2, 291, 57, "Riflemen", sovMen );
  443.       group_attack_to_order( 2, 333, 36 );
  444.       create_unit( 2, 291, 57, "Tank", 1 );
  445.       group_attack_to_order( 2, 333, 36 );
  446.       create_unit( 2, 291, 57, "Heavy Machine Gun", 1 );
  447.       group_attack_to_order( 2, 333, 36 );
  448.     }
  449.     else if ( find_city_owner( "South Rail Station" ) != 2 )
  450.     {
  451.       create_unit( 2, 333, 36, "Riflemen", sovMen );
  452.       group_attack_to_order( 2, 338, 100 );
  453.       create_unit( 2, 333, 36, "Tank", 1 );
  454.       group_attack_to_order( 2, 338, 100 );
  455.       create_unit( 2, 333, 36, "Heavy Machine Gun", 1 );
  456.       group_attack_to_order( 2, 338, 100 );
  457.     }
  458.     else if ( find_city_owner( "South Bank Industrial" ) != 2 )
  459.     {
  460.       create_unit( 2, 338, 100, "Riflemen", sovMen );
  461.       group_attack_to_order( 2, 318, 128 );
  462.       create_unit( 2, 338, 100, "Tank", 1 );
  463.       group_attack_to_order( 2, 318, 128 );
  464.       create_unit( 2, 338, 100, "Heavy Machine Gun", 1 );
  465.       group_attack_to_order( 2, 318, 128 );
  466.     }
  467.     
  468.     set_timer( "sovinforce", 60 );
  469.     enable_trigger( "sov_attack" );
  470.   }
  471.  
  472.   trigger ger_attack( timer_expired( "gerinforce" ) )
  473.   {
  474.     // These variables will make it easier to balance later
  475.     int gerMen = 7;
  476.     
  477.     // Northern Group
  478.     if ( find_city_owner( "Industrial NNW" ) == 5 && find_city_owner( "North Crossing A" ) != 5 )
  479.     {
  480.       create_unit( 5, 42, 345, "Infantry", gerMen );
  481.       group_attack_to_order( 5, 72, 289 );
  482.       create_unit( 5, 42, 345, "Tank", 1 );
  483.       group_attack_to_order( 5, 72, 289 );
  484.       create_unit( 5, 42, 345, "Armored Scout Car", 1 );
  485.       group_attack_to_order( 5, 72, 289 );
  486.     }
  487.     else if ( find_city_owner( "North Crossing B" ) != 5 )
  488.     {
  489.       create_unit( 5, 72, 289, "Infantry", gerMen );
  490.       group_attack_to_order( 5, 55, 263 ); 
  491.       create_unit( 5, 72, 289, "Tank", 1 );
  492.       group_attack_to_order( 5, 55, 263 );
  493.       create_unit( 5, 72, 289, "Armored Scout Car", 1 );
  494.       group_attack_to_order( 5, 55, 263 );     
  495.     }
  496.     else if ( find_city_owner( "Northwest" ) != 5 )
  497.     {
  498.       create_unit( 5, 55, 263, "Infantry", gerMen );
  499.       group_attack_to_order( 5, 33, 219 );
  500.       create_unit( 5, 55, 263, "Tank", 1 );
  501.       group_attack_to_order( 5, 33, 219 );
  502.       create_unit( 5, 55, 263, "Armored Scout Car", 1 );
  503.       group_attack_to_order( 5, 33, 219 );    
  504.     }
  505.     else if ( find_city_owner( "City Square" ) != 5 )
  506.     {
  507.       create_unit( 5, 33, 219, "Infantry", gerMen );
  508.       group_attack_to_order( 5, 49, 173 );
  509.       create_unit( 5, 33, 219, "Tank", 1 );
  510.       group_attack_to_order( 5, 49, 173 );
  511.       create_unit( 5, 33, 219, "Armored Scout Car", 1 );
  512.       group_attack_to_order( 5, 49, 173 );
  513.     }
  514.     else if ( find_city_owner( "North Northwest" ) != 5 )
  515.     {
  516.       create_unit( 5, 49, 173, "Infantry", gerMen );
  517.       group_attack_to_order( 5, 72, 128 );
  518.       create_unit( 5, 49, 173, "Tank", 1 );
  519.       group_attack_to_order( 5, 72, 128 );
  520.       create_unit( 5, 49, 173, "Armored Scout Car", 1 );
  521.       group_attack_to_order( 5, 72, 128 );    
  522.     }
  523.     else if ( find_city_owner( "Northeast Corner" ) != 5 )
  524.     {
  525.       create_unit( 5, 72, 128, "Infantry", gerMen );
  526.       group_attack_to_order( 5, 12, 33 );
  527.       create_unit( 5, 72, 128, "Tank", 1 );
  528.       group_attack_to_order( 5, 12, 33 );
  529.       create_unit( 5, 72, 128, "Armored Scout Car", 1 );
  530.       group_attack_to_order( 5, 12, 33 );    
  531.     }
  532.     
  533.     // Middle Group
  534.     if ( find_city_owner( "Industrial Southwest" ) == 4 && find_city_owner( "Industrial Residence" ) != 4 )
  535.     {
  536.       create_unit( 4, 311, 320, "Infantry", gerMen );
  537.       group_attack_to_order( 4, 259, 280 );
  538.       create_unit( 4, 311, 320, "Tank", 1 );
  539.       group_attack_to_order( 4, 259, 280 );
  540.       create_unit( 4, 311, 320, "Armored Scout Car", 1 );
  541.       group_attack_to_order( 4, 259, 280 );
  542.     }
  543.     else if ( find_city_owner( "West Crossing A" ) != 4 )
  544.     {
  545.       create_unit( 4, 259, 280, "Infantry", gerMen );
  546.       group_attack_to_order( 4, 231, 237 );
  547.       create_unit( 4, 259, 280, "Tank", 1 );
  548.       group_attack_to_order( 4, 231, 237 );
  549.       create_unit( 4, 259, 280, "Armored Scout Car", 1 );
  550.       group_attack_to_order( 4, 231, 237 );    
  551.     }
  552.     else if ( find_city_owner( "West Crossing B" ) != 4 )
  553.     {
  554.       create_unit( 4, 231, 237, "Infantry", gerMen );
  555.       group_attack_to_order( 4, 227, 204 );
  556.       create_unit( 4, 231, 237, "Tank", 1 );
  557.       group_attack_to_order( 4, 227, 204 );
  558.       create_unit( 4, 231, 237, "Armored Scout Car", 1 );
  559.       group_attack_to_order( 4, 227, 204 );    
  560.     }
  561.     else if ( find_city_owner( "City Center" ) != 5 )
  562.     {
  563.       create_unit( 5, 227, 204, "Infantry", gerMen );
  564.       group_attack_to_order( 5, 167, 136 );
  565.       create_unit( 5, 227, 204, "Tank", 1 );
  566.       group_attack_to_order( 5, 167, 136 );
  567.       create_unit( 5, 227, 204, "Armored Scout Car", 1 );
  568.       group_attack_to_order( 5, 167, 136 );
  569.     }
  570.     else if ( find_city_owner( "Center Northeast" ) != 5 )
  571.     {
  572.       create_unit( 5, 167, 136, "Infantry", gerMen );
  573.       group_attack_to_order( 5, 108, 91 );
  574.       create_unit( 5, 167, 136, "Tank", 1 );
  575.       group_attack_to_order( 5, 108, 91 );
  576.       create_unit( 5, 167, 136, "Armored Scout Car", 1 );
  577.       group_attack_to_order( 5, 108, 91 );    
  578.     }
  579.     else if ( find_city_owner( "Northeast Corner" ) != 5 )
  580.     {
  581.       create_unit( 5, 108, 91, "Infantry", gerMen );
  582.       group_attack_to_order( 5, 39, 34 ); 
  583.       create_unit( 5, 108, 91, "Tank", 1 );
  584.       group_attack_to_order( 5, 39, 34 );
  585.       create_unit( 5, 108, 91, "Armored Scout Car", 1 );
  586.       group_attack_to_order( 5, 39, 34 );   
  587.     }
  588.     
  589.     // Mid South Group
  590.     
  591.     if ( find_city_owner( "South Bank Industrial" ) == 4 && find_city_owner( "Industrial South" ) != 4 )
  592.     {
  593.       create_unit( 4, 342, 265, "Infantry", gerMen );
  594.       group_attack_to_order( 4, 331, 239 );
  595.       create_unit( 4, 342, 265, "Tank", 1 );
  596.       group_attack_to_order( 4, 331, 239 );
  597.       create_unit( 4, 342, 265, "Armored Scout Car", 1 );
  598.       group_attack_to_order( 4, 331, 239 );
  599.     }
  600.     else if ( find_city_owner( "South Crossing A" ) != 4 )
  601.     {
  602.       create_unit( 4, 331, 239, "Infantry", gerMen );
  603.       group_attack_to_order( 4, 294, 172 );
  604.       create_unit( 4, 331, 239, "Tank", 1 );
  605.       group_attack_to_order( 4, 294, 172 );
  606.       create_unit( 4, 331, 239, "Armored Scout Car", 1 );
  607.       group_attack_to_order( 4, 294, 172 );    
  608.     }
  609.     else if ( find_city_owner( "South Crossing B" ) != 4 )
  610.     {
  611.       create_unit( 4, 294, 172, "Infantry", gerMen );
  612.       group_attack_to_order( 4, 265, 152 );   
  613.       create_unit( 4, 294, 172, "Tank", 1 );
  614.       group_attack_to_order( 4, 265, 152 );
  615.       create_unit( 4, 294, 172, "Armored Scout Car", 1 );
  616.       group_attack_to_order( 4, 265, 152 ); 
  617.     }
  618.     else if ( find_city_owner( "Central South" ) != 4 )
  619.     {
  620.       create_unit( 4, 265, 152, "Infantry", gerMen );
  621.       group_attack_to_order( 4, 213, 158 );
  622.       create_unit( 4, 265, 152, "Tank", 1 );
  623.       group_attack_to_order( 4, 213, 158 );
  624.       create_unit( 4, 265, 152, "Armored Scout Car", 1 );
  625.       group_attack_to_order( 4, 213, 158 );
  626.     }
  627.     else if ( find_city_owner( "Suburbs" ) != 5 )
  628.     {
  629.       create_unit( 5, 213, 158, "Infantry", gerMen );
  630.       group_attack_to_order( 5, 156, 84 );
  631.       create_unit( 5, 213, 158, "Tank", 1 );
  632.       group_attack_to_order( 5, 156, 84 );
  633.       create_unit( 5, 213, 158, "Armored Scout Car", 1 );
  634.       group_attack_to_order( 5, 156, 84 );    
  635.     }
  636.     else if ( find_city_owner( "Northeast Corner" ) != 5 )
  637.     {
  638.       create_unit( 5, 156, 84, "Infantry", gerMen );
  639.       group_attack_to_order( 5, 84, 14 );
  640.       create_unit( 5, 156, 84, "Tank", 1 );
  641.       group_attack_to_order( 5, 84, 14 );
  642.       create_unit( 5, 156, 84, "Armored Scout Car", 1 );
  643.       group_attack_to_order( 5, 84, 14 );    
  644.     }
  645.     
  646.     // South Group
  647.     if ( find_city_owner( "Industrial Southeast" ) == 4 && find_city_owner( "South Rail Station" ) != 4 )
  648.     {
  649.       create_unit( 4, 318, 128, "Infantry", gerMen );
  650.       group_attack_to_order( 4, 338, 100 );
  651.       create_unit( 4, 318, 128, "Tank", 1 );
  652.       group_attack_to_order( 4, 338, 100 );
  653.       create_unit( 4, 318, 128, "Armored Scout Car", 1 );
  654.       group_attack_to_order( 4, 338, 100 );
  655.     }
  656.     else if ( find_city_owner( "Southwest Corner" ) != 4 )
  657.     {
  658.       create_unit( 4, 338, 100, "Infantry", gerMen );
  659.       group_attack_to_order( 4, 333, 36 );
  660.       create_unit( 4, 338, 100, "Tank", 1 );
  661.       group_attack_to_order( 4, 333, 36 );
  662.       create_unit( 4, 338, 100, "Armored Scout Car", 1 );
  663.       group_attack_to_order( 4, 333, 36 );    
  664.     }
  665.     else if ( find_city_owner( "Southwest Square" ) != 4 )
  666.     {
  667.       create_unit( 4, 333, 36, "Infantry", gerMen );
  668.       group_attack_to_order( 4, 291, 57 );
  669.       create_unit( 4, 333, 36, "Tank", 1 );
  670.       group_attack_to_order( 4, 291, 57 );
  671.       create_unit( 4, 333, 36, "Armored Scout Car", 1 );
  672.       group_attack_to_order( 4, 291, 57 );    
  673.     }
  674.     else if ( find_city_owner( "East Crossing B" ) != 4 )
  675.     {
  676.       create_unit( 4, 291, 57, "Infantry", gerMen );
  677.       group_attack_to_order( 4, 238, 91 );
  678.       create_unit( 4, 291, 57, "Tank", 1 );
  679.       group_attack_to_order( 4, 238, 91 );
  680.       create_unit( 4, 291, 57, "Armored Scout Car", 1 );
  681.       group_attack_to_order( 4, 238, 91 );
  682.     }
  683.     else if ( find_city_owner( "East Bank Industrial" ) != 4 )
  684.     {
  685.       create_unit( 4, 238, 91, "Infantry", gerMen );
  686.       group_attack_to_order( 4, 195, 21 );
  687.       create_unit( 4, 238, 91, "Tank", 1 );
  688.       group_attack_to_order( 4, 195, 21 );
  689.       create_unit( 4, 238, 91, "Armored Scout Car", 1 );
  690.       group_attack_to_order( 4, 195, 21 );    
  691.     }
  692.     
  693.     set_timer( "gerinforce", 60 );
  694.     enable_trigger( "ger_attack" );
  695.   }
  696.     
  697.   trigger shell_all ( timer_expired( "allshell" ) )
  698.   {
  699.     // I should note here that the amount of destruction caused by each shell is directly linked to
  700.     // the attack of the unit being killed.  In this case, the attack of the helicopter unit.
  701.     // The actual damage dealt is somewhere around 10% of the attack value of the unit.
  702.        
  703.     rand_seed( time_sec() );
  704.     rallyID = 0;
  705.     
  706.     if ( num_cities( 2 ) > 0 )
  707.     {
  708.       // This if loop prevents the shells from falling if player 2 doesn't control a city
  709.       // The effect is to prevent the possibility of an infinite loop
  710.       for (i = 0; i < rand_int(MIN_SHELL,MAX_SHELL); i++ )
  711.       {
  712.         do 
  713.         {
  714.         X = rand_int( 1, 360 );
  715.         Y = rand_int( 1, 360 );
  716.         } while ( territory_owner( X, Y ) != 2 ); // Loop while the territory doesn't satisfy this requirement
  717.         create_unit( 4, X, Y, "Helicopter", 1 );
  718.         rallyID = find_unit( 4, "Helicopter" );
  719.         set_unit_scale( 4, rallyID, 0.01);
  720.         kill_unit_type_anim( 4, "Helicopter", 4);
  721.       }
  722.     }
  723.     
  724.     set_timer( "allshell", ALL_SHELL_DELAY );
  725.     enable_trigger( "shell_all" );
  726.   }
  727.   
  728.   trigger sovshell_all ( timer_expired( "sovshell" ) )
  729.   {
  730.     // I should note here that the amount of destruction caused by each shell is directly linked to
  731.     // the attack of the unit being killed.  In this case, the attack of the helicopter unit.
  732.     // The actual damage dealt is somewhere around 10% of the attack value of the unit.
  733.        
  734.     rand_seed( time_sec() );
  735.     rallyID = 0;
  736.     
  737.     if ( ( num_cities( 4 ) > 0 ) && ( num_cities( 5 ) > 0 ) )
  738.     {
  739.       // This if loop prevents the shells from falling if player 4 or five doesn't control a city
  740.       // The effect is to prevent the possibility of an infinite loop
  741.       for (i = 0; i < rand_int(6,8); i++ )
  742.       {
  743.         do 
  744.         {
  745.         X = rand_int( 1, 360 );
  746.         Y = rand_int( 1, 360 );
  747.         } while ( territory_owner( X, Y ) == 2 ); // Loop while the territory doesn't satisfy this requirement
  748.         create_unit( 2, X, Y, "Helicopter", 1 );
  749.         rallyID = find_unit( 2, "Helicopter" );
  750.         set_unit_scale( 2, rallyID, 0.01);
  751.         kill_unit_type_anim( 2, "Helicopter", 4);
  752.       }
  753.     }
  754.     
  755.     set_timer( "allshell", SOV_SHELL_DELAY );
  756.     enable_trigger( "shell_all" );
  757.   }
  758.   
  759.   trigger ability_charger ( timer_expired( "chargeability" ) )
  760.   {
  761.     if ( current_level >= 2 )
  762.     {
  763.       // Lead Ability
  764.       lead_percent += 3;
  765.       if ( lead_percent > lead_max )
  766.       {
  767.         lead_percent = lead_max;
  768.       }
  769.       change_objective_text( "lead_ability", "(L)ead: [" + lead_percent + "%] charged" );
  770.     }
  771.     if ( current_level >= 4 && ( time_sec() % 3 == 0 ) )
  772.     {
  773.       // Heal Ability
  774.       heal_percent += 5;
  775.       if ( heal_percent > heal_max )
  776.       {
  777.         heal_percent = heal_max;
  778.       }
  779.       change_objective_text( "heal_ability", "H(e)al: [" + heal_percent + "%] charged" );
  780.     }
  781.     if ( current_level >= 6 )
  782.     {
  783.       rally_percent++;
  784.       if ( rally_percent > rally_max )
  785.       {
  786.         rally_percent = rally_max;
  787.       }
  788.       change_objective_text( "rally_ability", "Rall(y): [" + rally_percent + "%] charged" );
  789.     }
  790.     if ( current_level >= 8 && ( time_sec() % 5 == 0 ) )
  791.     {
  792.       // Artillery Strike Ability
  793.       artillery_percent += 3;
  794.       if ( artillery_percent > artillery_max )
  795.       {
  796.         artillery_percent = artillery_max;
  797.       }
  798.       change_objective_text( "artillery_ability", "Art(i)llery: [" + artillery_percent + "%] charged" );
  799.     }
  800.   
  801.     set_timer( "chargeability", 1 );
  802.     enable_trigger( "ability_charger" );
  803.   }
  804.   
  805.   trigger auto_heal ( timer_expired( "healing" ) )
  806.   {
  807.     // This trigger heals the player 1%
  808.     heal_object( 1, commandoID, 1);
  809.     
  810.     set_timer( "healing", healDelay );
  811.     enable_trigger( "auto_heal" );
  812.   }
  813.   
  814.   trigger gain_exp ( num_units_killed( 1 ) > last_index_of_kills )
  815.   {
  816.     // Kill a guy and gain experience
  817.     
  818.     print_game_msg( "Gained " + ( num_units_killed( 1 ) - last_index_of_kills ) + " experience" );
  819.     exp_gained += ( num_units_killed( 1 ) - last_index_of_kills );
  820.   
  821.     last_index_of_kills = num_units_killed( 1 );
  822.     change_objective_text( "exp", "[" + exp_gained + "/" + exp_needed + "] Experience" );
  823.         
  824.     enable_trigger ( "gain_exp" );
  825.   }
  826.   
  827.   trigger level_up ( exp_gained >= exp_needed )
  828.   {
  829.     
  830.     exp_gained -= exp_needed;  // This allows for overflow
  831.     exp_needed += 1 + current_level;
  832.     current_level++;
  833.     current_health = (int) ( current_health * 1.10 );
  834.     set_object_type_max_health( "Special Forces", current_health );
  835.     
  836.     change_objective_text( "level", "Current Level: " + current_level );
  837.     change_objective_text( "exp", "[" + exp_gained + "/" + exp_needed + "] Experience" );
  838.     print_game_msg( "Leveled up!" );
  839.     play_sound( "lvl.wav" );
  840.     
  841.     if ( current_level == 2 )
  842.     {
  843.       // Gain Lead Ability
  844.       add_objective_text( "(L)ead: [" + lead_percent + "%] charged", "lead_ability", "null.wav" );
  845.       popup_dialog( "You have a new ability:  The stalwart courage you have shown will inspire the men around you.  When the ability is charged, press 'L' to activate." );
  846.     }
  847.     else if ( current_level == 4 )
  848.     {
  849.       // Gain Heal Ability
  850.       
  851.       add_objective_text( "H(e)al: [" + heal_percent + "%] charged", "heal_ability", "null.wav" );
  852.       popup_dialog( "You have a new ability:  You have been supplied with medical equipment, enough to tend to yourself for light injuries.  When the ability is charged, press 'E' to activate. " );
  853.       
  854.       // Improve hiding
  855.       lead_max += 5;
  856.     }
  857.     else if ( current_level == 6 )
  858.     {
  859.       // Gain Rally Ability
  860.       
  861.       add_objective_text( "Rall(y): [" + rally_percent + "%] charged", "rally_ability", "null.wav" );
  862.       popup_dialog( "You have a new ability:  Stavka is so impressed with your leadership that they have allowed you to call in troops to attack at your position.  When the ability is charged, press 'Y' to activate. " );
  863.       
  864.       // Improve
  865.       lead_max += 5;
  866.       heal_max += 5;
  867.     }
  868.     else if ( current_level == 8 )
  869.     {
  870.       // Gain Artillery Strike Ability
  871.       
  872.       add_objective_text( "Art(i)llery: [" + artillery_percent + "%] charged", "artillery_ability", "null.wav" );
  873.       popup_dialog( "You have a new ability:  You have been granted a radio with which to call in artillery strikes.  When the ability is charged, press 'I' to activate. " );
  874.       
  875.       // Improve
  876.       lead_max += 5;
  877.       heal_max += 5;
  878.       rally_max += 5;
  879.     }
  880.     else if ( current_level < 10 )
  881.     {
  882.       // Upgrade Healing
  883.       healDelay--;
  884.     }
  885.     
  886.     enable_trigger( "level_up" );
  887.   }
  888.   
  889.   trigger lead_ability_use( key_down( "l" ) && ( lead_percent >= 100 ) && ( !is_trigger_enabled( "move_the_gen" ) ) )
  890.   {
  891.     lead_percent -= 100;
  892.     
  893.     X = object_position_x( 1, commandoID );
  894.     Y = object_position_y( 1, commandoID );
  895.     
  896.     create_unit( 2, X, Y, "General", 1 );
  897.             
  898.     enable_trigger( "move_the_gen" );
  899.     set_timer( "kill_general", 20 );
  900.     enable_trigger( "lead_ability_use" );
  901.   }
  902.    
  903.   trigger kill_the_gen( timer_expired( "kill_general" ) )
  904.   {
  905.     rallyID = find_unit( 2, "General" );
  906.     
  907.     kill_unit_anim( 2, rallyID, 1 );
  908.         
  909.     disable_trigger( "move_the_gen" );   
  910.     enable_trigger( "kill_the_gen" );
  911.   }
  912.   
  913.   trigger move_the_gen ( )
  914.   {
  915.     rallyID = find_unit( 2, "General" );
  916.     
  917.     X = object_position_x( 1, commandoID );
  918.     Y = object_position_y( 1, commandoID );
  919.     
  920.     unit_move_order( 2, rallyID, X-3, Y-3 );    
  921.     
  922.     enable_trigger( "move_the_gen" );
  923.     
  924.   }
  925.   
  926.   trigger heal_ability_use ( key_down( "e" ) && ( heal_percent >= 100 )  )
  927.   {
  928.     heal_percent -= 100;
  929.       
  930.     heal_object( 1, commandoID, 20);
  931.     
  932.     enable_trigger( "heal_ability_use" );
  933.   }
  934.   
  935.   trigger rally_ability_use ( key_down( "y" ) && ( rally_percent >= 100 ) )
  936.   {
  937.     rally_percent -= 100;
  938.     
  939.     X = object_position_x( 1, commandoID );
  940.     Y = object_position_y( 1, commandoID ); 
  941.     
  942.     create_unit( 2, X+2, Y+2, "Riflemen", 4 );
  943.     create_unit( 2, X+2, Y+2, "Heavy Machine Gun", 1 );
  944.     
  945.     enable_trigger( "rally_ability_use" );
  946.   }
  947.   
  948.   
  949.   trigger artillery_ability_use ( key_down( "i" ) && ( artillery_percent >= 100 ) &&( !is_trigger_enabled( "player_unleashes" ) ) )
  950.   {
  951.     artillery_percent -= 100;
  952.     artillery_fired = 0;
  953.       
  954.     mouseX = get_mouse_game_x();
  955.     mouseY = get_mouse_game_y();
  956.       
  957.     enable_trigger( "player_unleashes" );
  958.     set_timer( "unleasher", 1 );
  959.     
  960.     enable_trigger( "artillery_ability_use" );
  961.   }
  962.   
  963.   trigger player_unleashes ( timer_expired( "unleasher" ) )
  964.   {
  965.     rallyID = 0;
  966.   
  967.     rand_seed( time_sec() );
  968.     for( i = 0; i < 8; i++ )
  969.     {
  970.       // Generate random point
  971.       // Subtract 10 to put it about on target
  972.       X = rand_int( mouseX - 15, mouseX + ART_RADIUS - 15 );
  973.       Y = rand_int( mouseY - 15, mouseY + ART_RADIUS - 15 );
  974.     
  975.       create_unit( 1, X, Y, "Helicopter", 1 );
  976.       rallyID = find_unit( 1, "Helicopter" );
  977.       set_unit_scale( 1, rallyID, 0.01);
  978.       kill_unit_type_anim( 1, "Helicopter", 4);        
  979.     }
  980.   
  981.     artillery_fired++;
  982.   
  983.     if ( artillery_fired < 5 )
  984.     {
  985.       set_timer( "unleasher", 1 );
  986.       enable_trigger( "player_unleashes" );
  987.     }
  988.   }
  989.   
  990.   trigger player_garrison ( is_garrisoned( 1, commandoID ) && ( garrisoned_in( 1, commandoID ) == 2004 ) )
  991.   {
  992.     int tempID;
  993.     
  994.     create_unit( 1, 37, 26, "Special Forces", 1 );
  995.     do
  996.     {
  997.       rallyID = find_unit( 1, "Special Forces" );
  998.     } while ( rallyID == commandoID );
  999.     
  1000.     tempID = commandoID;
  1001.     commandoID = rallyID;
  1002.     kill_unit_anim( 1, tempID, 1 );
  1003.     
  1004.     enable_trigger( "player_garrison" );    
  1005.   } 
  1006.   
  1007.   trigger invuln_barracks( )
  1008.   {
  1009.   
  1010.     set_object_health( 1, 2004, 100 );
  1011.   
  1012.     enable_trigger( "invuln_barracks" );
  1013.   } 
  1014.   
  1015.   trigger the_dance ( is_defeated( 5 ) || is_defeated( 4 ) )
  1016.   {
  1017.     popup_dialog( "German forces, delivered a severe blow by attacking Soviet armies, have fallen back to regroup.  This victory is no doubt due in part to your superb actions.  Good work." );
  1018.     popup_dialog( "You are now ready for the tenth part of this campaign.  Please load the next scenario in the Red Front sequence." );
  1019.     victory( 1 );
  1020.   }
  1021. }